package com.simplegovern.dict.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.simpleframe.persistence.hibernate.Page;
import com.simpleframe.persistence.hibernate.Searcher;
import com.simplegovern.dict.Dict;
import com.simplegovern.dict.dao.DictDAO;

public class DictService {

	@Autowired
	private DictDAO dictDAO;
	
	public Dict getById(long id){
		return dictDAO.findById(id);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void deletes(Long[] ids){
		dictDAO.deletes(ids);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void create(Dict dict){
		dictDAO.save(dict);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void update(Dict dict){
		dictDAO.update(dict);
	}
	
	//以上自动生成
	
	public Page getPage(Searcher searcher){
		return dictDAO.getPage(searcher);
	}

}
